package com.eightbears.beboy.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eightbears.beboy.R;
import com.eightbears.beboy.base.util.CommonUtils;
import com.eightbears.beboy.entity.SystemMessageCommonEntity;

/**
 *
 * Created by Bao on 2016/12/7.
 */

public class SystemCommonAdapter extends BaseQuickAdapter<SystemMessageCommonEntity.SystemCommentEntity, BaseViewHolder> {

    public SystemCommonAdapter() {
        super(R.layout.item_system_common, null);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, SystemMessageCommonEntity.SystemCommentEntity systemMessageCommonEntity) {

        baseViewHolder.setText(R.id.tv_nickname, systemMessageCommonEntity.getFrom_user().getNickname())
                .setText(R.id.tv_publish_date, CommonUtils.TimeStamp2Date(systemMessageCommonEntity.getCreated_at(), "yyyy-MM-dd HH:mm"))
                .addOnClickListener(R.id.ll_item);
        CommonUtils.loadImageView(mContext,systemMessageCommonEntity.getFrom_user().getCover(),
                R.mipmap.default_head, (ImageView) baseViewHolder.getView(R.id.iv_user_head) );

    }
}
